/*
 * LeafNode.h
 *
 *  Created on: Oct 9, 2011
 *      Author: USHonDan
 */

#ifndef LEAFNODE_H_
#define LEAFNODE_H_

#include "../StorageManager/Record.h"
#include "Node.h"

class LeafNode : public Node {
public:
	LeafNode();
	~LeafNode();

	int InsertRecord(int key, Record *rec);
	Record *GetRecord(int key);
	LeafNode *GetPrevious();
	LeafNode *GetNext();
	void SetPrevious(LeafNode *leaf);
	void SetNext(LeafNode *leaf);
	int SplitLeaf(LeafNode *nextEmpty, int splitIdx); //returns last index of first node

private:
	Record **_recPtrs;
	LeafNode *_nextLeaf;
	LeafNode *_previousLeaf;
};

#endif /* LEAFNODE_H_ */
